(async () => {
  const mysql = require('promise-mysql2')
  // 连接配置
  const cfg = {
    host: "localhost",
    user: "root",
    password: "admin", // 修改为你的密码
    database: "kaikeba" // 请确保数据库存在
  }
  const connection = await mysql.createConnection(cfg)
  const result = connection.query('select `message` from test');
  result.then(([rows, fields])=>{
    console.log(rows)
  })
})()